<?php

namespace catchAdmin\apidoctor\validate;

use think\Validate;

class CircleValidate extends Validate
{
    protected $rule = [
        'id' => 'require',
        'type' => [
            'require',
            'in:1,2'
        ],
        'title' => 'require',
        'doctor_code' => 'require',
        'patientList' => 'require|array',
        'group_id|群组id' => [
            'require'
        ],
        'media_list|媒体列表' => [
            'require',
            'array'
        ],
        'parentId|上级id' => [

        ],
        'content|评论/回复内容' => [
            'require'
        ],
        'circle_id|朋友圈id' => [
            'require'
        ],
        'patientId|患者id' => 'require|array'
    ];

    protected $message = [
        'id.require' => '缺少ID',
        'title.require' => '缺少朋友圈文案',
        'type.require' => '缺少发布人类型',
        'doctor_code.require' => '缺少医生编号',
        'patientList.require' => '缺少patientList参数',
        'patientList.array' => 'patientList参数类型错误',

    ];

    protected $scene = [
        'establish' => ['doctor_code', 'title'],
        'group_chat_list' => ['doctor_code'],
        'group_chat_info' => ['id'],
        'modify_group_chat_info' => ['id'],
        'add_group_chat_patient' => ['id', 'patientList'],
        'dissolution' => ['id', 'doctor_code'],
        'part_list' => ['id', 'doctor_code'],
        'release' => ['group_id', 'media_list', 'title', 'type'],
        'comment' => ['circle_id', 'content', 'parentId'],
        'group_chat_head' => ['id'],
        'joined_members' => ['id'],
        'remove_members' => ['id', 'doctor_code', 'patientId']
    ];
}